<template>
  <template v-for="item in menuTree" :key="item._id">
 
    <el-submenu v-if="item.childlist && item.childlist.length>0 && item.childlist[0].ismenu == 1" :key="item._id" :index="item.name">
			<template #title>
				 
				  <component class="icons"  :is="item.icon" style="font-size: 5px; " width="20"></component>
				<span>{{item.title}}</span>
			</template>
			<tree-menu :menuTree="item.childlist"/>
	</el-submenu>
	<el-menu-item v-else-if="item.ismenu == 1" :index="item.name" :key="item._id">  <component class="icons"  :is="item.icon" style="font-size: 5px; " width="20"></component>
	<span>{{item.title}}</span></el-menu-item>
  </template>
</template>

<script>
export default {
	name:'TreeMenu',
	props:{
		menuTree:{
			type:Array,
			default:()=>[]
		}
	}
}
</script>

<style>

</style>